package com.example.newstest.news.bean.heardline;

import android.databinding.ObservableInt;
import android.support.v4.view.PagerAdapter;

import com.example.newstest.BR;
import com.example.newstest.R;
import com.example.newstest.until.CommentPagerAdapter;
import com.google.gson.annotations.Expose;

import java.util.List;

/**
 * Created by Administrator on 2017/1/14.
 */
public class HeardLineList {
    private List<HeardLineData> list;
    @Expose(serialize = false, deserialize = false)
    private PagerAdapter adapter;

    @Expose(serialize = false,deserialize = false)
    private ObservableInt currentPage = new ObservableInt(0);

    public HeardLineList(List<HeardLineData> list) {
        this.list = list;
    }

    public List<HeardLineData> getList() {
        return list;
    }

    public void setList(List<HeardLineData> list) {
        this.list = list;
    }

    public PagerAdapter getAdapter() {
        if (adapter==null) {
            adapter = new CommentPagerAdapter(list, R.layout.news_first_heardline_item, BR.heardLineData);
        }
        return adapter;
    }

    public void setAdapter(PagerAdapter adapter) {
        this.adapter = adapter;
    }

    public ObservableInt getCurrentPage() {
        return currentPage;
    }

    public void setCurrentPage(ObservableInt currentPage) {
        this.currentPage = currentPage;
    }
}
